package com.express.service;

import com.express.bean.Courier;
import com.express.dao.BaseCourierDao;
import com.express.dao.impl.CourierDaoMysql;

import java.util.List;
import java.util.Map;

/**
 * @Author: laixiangdong
 * @Date 2020/12/08
 */
public class CourierService {
    private static BaseCourierDao dao = new CourierDaoMysql();

    public static Map<String, Integer> console() {
        return dao.console();
    }

    public static List<Courier> findAll(boolean limit, int offset, int pageNumber) {
        return dao.findAll(limit, offset, pageNumber);
    }

    public static Courier findByPhone(String phone) {
        return dao.findByPhone(phone);
    }

    public static Boolean insert(Courier courier) {
        return dao.insert(courier);
    }

    public static Boolean update(int id, Courier newCourier) {
        return dao.update(id, newCourier);
    }

    public static Boolean delete(int id) {
        return dao.delete(id);
    }
}
